package com.ding.utils;

import org.activiti.engine.ActivitiException;
import org.apache.commons.mail.EmailException;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

public class ExceptionUtils {
	public static void activitiException(ActivitiException e,RedirectAttributes redirectAttributes) {
		Throwable cause = e.getCause();
		if (cause instanceof EmailException) {
			redirectAttributes.addFlashAttribute("error", "启动失败-请检查邮箱收件人是否正确,如果有多个收件人请使用英文逗号分隔");
		}
		else {
			redirectAttributes.addFlashAttribute("error", "启动失败"+e.getMessage());
		}
	
	}
}
